import tushare as ts
import pandas as pd
import matplotlib.pyplot as plt

# 设置你的 Token （这里方便以后的Demo放在了TXT文件中）
with open('D:\\code\\python\\tushareToken.txt', 'r', encoding='utf-8') as file:
    token = file.read().strip()
    ts.set_token(token)
pro = ts.pro_api()


def getDayStock(stockCode, startDate, endDate):
    return pro.daily(ts_code=stockCode, start_date=startDate, end_date=endDate)


def getRealTime(stockCode):
    return ts.realtime_quote(ts_code=stockCode)
